//
//  OrderViewController.m
//  1243
//
//  Created by apple on 16/7/11.
//  Copyright © 2016年 1243. All rights reserved.
//

#import "OrderViewController.h"
#import "SizeFiteLabel.h"

@interface OrderViewController ()<UITextFieldDelegate>

@end

@implementation OrderViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    [self createUI];
}

- (void)createUI {
    UIImageView *image = [[UIImageView alloc]initWithFrame:CGRectMake(10, 0, WIDTH/3, WIDTH/3)];
    image.backgroundColor = [UIColor redColor];
    [self.view addSubview:image];
    
    SizeFiteLabel *titleLB = [[SizeFiteLabel alloc]initWithFrame:CGRectMake(WIDTH/3 + 20, 10, WIDTH - (WIDTH/3 + 40), 10)];
    titleLB.mHV = NO;
    titleLB.mContent = self.titleName;
    [self.view addSubview:titleLB];
    
    UILabel *qiLB = [[UILabel alloc]initWithFrame:CGRectMake(WIDTH/3 + 20, 70, 100, 15)];
    qiLB.text = self.qi;
    qiLB.font = [UIFont systemFontOfSize:12];
    [self.view addSubview:qiLB];
    
    UILabel *numLB = [[UILabel alloc]initWithFrame:CGRectMake(WIDTH/3 + 20, 85, 100, 15)];
    numLB.text = [NSString stringWithFormat:@"参与人次:%@",self.num];
    numLB.font = [UIFont systemFontOfSize:12];
    [self.view addSubview:numLB];
    
    UILabel *grayLine = [[UILabel alloc]initWithFrame:CGRectMake(0, WIDTH/3, WIDTH, 10)];
    grayLine.backgroundColor = [UIColor colorWithRed:228/255.0 green:229/255.0 blue:234/255.0 alpha:1];
    [self.view addSubview:grayLine];
    
    UILabel *phoneLB = [[UILabel alloc]initWithFrame:CGRectMake(10, WIDTH/3 + 20, 70, 30)];
    phoneLB.text = @"手机号码";
    phoneLB.font = [UIFont systemFontOfSize:14];
    [self.view addSubview:phoneLB];
    
    UITextField *view = [[UITextField alloc]initWithFrame:CGRectMake(90, WIDTH/3 + 20, WIDTH - 110, 30)];
    view.delegate = self;
    view.placeholder = @"请输入手机号，抢中宝贝将通知您";
    view.font = [UIFont systemFontOfSize:14];
    view.layer.borderWidth = 0.5;
    view.layer.borderColor = [[UIColor lightGrayColor] CGColor];
    [self.view addSubview:view];
    
    
    UILabel *lineLB = [[UILabel alloc]initWithFrame:CGRectMake(0, WIDTH/3 + 60, WIDTH, 1)];
    lineLB.backgroundColor = [UIColor grayColor];
    [self.view addSubview:lineLB];
    
    UILabel *moneyLB = [[UILabel alloc]initWithFrame:CGRectMake(WIDTH - 220, WIDTH/3 + 75, 100, 30)];
    moneyLB.text = self.money;
    moneyLB.font = [UIFont systemFontOfSize:15];
    [self.view addSubview:moneyLB];
    
    UIButton *xiaDanBut = [UIButton buttonWithType:UIButtonTypeCustom];
    xiaDanBut.frame = CGRectMake(WIDTH - 110, WIDTH/3 + 70, 100, 40);
    xiaDanBut.layer.masksToBounds = YES;
    xiaDanBut.layer.cornerRadius = 5;
    [xiaDanBut setTitle:@"立即下单" forState:UIControlStateNormal];
    [xiaDanBut setBackgroundColor:[UIColor colorWithRed:45/255.0 green:85/255.0 blue:229/255.0 alpha:1]];
    [self.view addSubview:xiaDanBut];
    
    
}

-(BOOL)textFieldShouldReturn:(UITextField *)textField {
    [textField resignFirstResponder];
    return YES;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
